package com.hs.srm.admin.modules.harmfulsubstance.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.hs.srm.admin.modules.harmfulsubstance.dao.SvhcHeadDao;
import com.hs.srm.admin.modules.harmfulsubstance.entity.SvhcHeadEntity;
import com.hs.srm.admin.modules.harmfulsubstance.service.SvhcHeadService;
import com.hs.srm.admin.modules.harmfulsubstance.vo.SvhcVendorVO;
import com.hs.srm.base.common.utils.QueryParam;
import com.hs.srm.common.utils.PageUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

/**
 * ServiceImpl实现类
 *
 * @author ych
 * @since 2020-03-12 09:11:25
 */
@Service("svhcHeadService")
public class SvhcHeadServiceImpl extends ServiceImpl<SvhcHeadDao, SvhcHeadEntity> implements SvhcHeadService {

    @Resource
    private SvhcHeadDao svhcHeadDao;

    /**
     * 查询SQE新增的物质清单，供应商登录显示
     * @param params
     * @return
     */
    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<SvhcVendorVO> page = new QueryParam<SvhcVendorVO>(params).getPage();
        page.setRecords(svhcHeadDao.selectSubVendorPage(page, new EntityWrapper<>(),params));
        return new PageUtils(page);
    }
}